<%@page import="com.wanmait.cookbook.vo.IngredientsTypeSecond"%>
<%@page import="com.wanmait.cookbook.vo.Userinfo"%>
<%@page import="org.eclipse.jdt.internal.compiler.ast.ForeachStatement"%>
<%@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"%>
<%@page import="com.wanmait.cookbook.vo.Pager"%>
<%@page import="com.wanmait.cookbook.vo.Works"%>
<%@page import="com.wanmait.cookbook.vo.Cookbook"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<!-- saved from url=(0056)https://www.douguo.com/caipu/%E5%AE%B6%E5%B8%B8%E8%8F%9C -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>家常菜的做法大全_家常菜的家常做法_家常菜怎么做好吃_豆果美食</title>
<link rel="icon"
	href="https://cp1.douguo.com/static/nweb/images/favicon.ico?v=1912"
	type="image/x-icon">
<link rel="stylesheet"
	href="<%=path%>/static/cookbookShow_files/main.css">
<link rel="stylesheet"
	href="<%=path%>/static/cookbookShow_files/search.css">
<script src="<%=path%>/static/cookbookShow_files/hm.js.下载"></script>
<script src="<%=path%>/static/cookbookShow_files/jquery.js.下载"></script>
<script data-ad-client="ca-pub-6608973961595981" async=""
	src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?f4fa5d56f272ae0a0777feec2184a97f";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
    </script>
<style>
.one-pan-tip {
	cursor: pointer;
}

.one-pan-tip::before {
	background-position: center;
	background-size: 100% 100%;
	background-repeat: no-repeat;
	box-sizing: border-box;
	width: 1em;
	height: 1em;
	margin: 0 1px .15em 1px;
	vertical-align: middle;
	display: inline-block;
}

.one-pan-tip-success::before {
	content: '';
	background-image:
		url()
}

.one-pan-tip-error {
	text-decoration: line-through;
}

.one-pan-tip-error::before {
	content: '';
	background-image:
		url()
}

.one-pan-tip-other::before {
	content: '';
	background-image:
		url()
}

.one-pan-tip-lock::before {
	content: '';
	background-image:
		url()
}
</style>
<meta name="ljjc::status" content="on">
</head>
<body>
	<jsp:include page="/inc/head.jsp"></jsp:include>

	<div class="wrap">
		<div id="content" class="clearfix">
			<div class="type-tab">
				<%
					String name = (String) request.getAttribute("name");
				%>
			</div>
			<div id="left">
				<div class="title-head">
					<h1 class="recipename">
						"<%=name%>"的相关信息
					</h1>
				</div>
				<div class="mt25" id="showList">
					<!--菜谱的一个展示  -->
					<ul class="cook-list" id="count">
						<!-- 进入页面默认加载 -->


						<%
							List<Cookbook> picToCookbooks = (List<Cookbook>) request.getAttribute("picToCookbooks");
							if (picToCookbooks.size() == 0) {
						%>
						<span>没有相关菜谱</span>
						<%
							} else {
								List<Integer> foodToCookCounts = (List<Integer>) request.getAttribute("foodToCookCounts");
								for (int i = 0; i < picToCookbooks.size(); i++) {
						%>

						<li class="clearfix"><a class="cook-img"
							href="<%=path %>/CookbookServlet?action=cookbookShow&id=<%=picToCookbooks.get(i).getId() %>"
							style="background-size: cover; position: relative;"
							title="<%=picToCookbooks.get(i).getInfo()%>" target="_blank"
							one-link-mark="yes"> <img
								src="<%=path%>/static/image/<%=picToCookbooks.get(i).getPic()%>"
								width="180" height="125"
								title="<%=picToCookbooks.get(i).getInfo()%>">
						</a>
							<div class="cook-info">
								<a class="cookname text-lips "
									href="<%=path %>/CookbookServlet?action=cookbookShow&id=<%=picToCookbooks.get(i).getId() %>"
									target="_blank" one-link-mark="yes"><%=picToCookbooks.get(i).getTitle()%></a>
								<!-- <p class="major">嫩豆腐,里脊肉,蒜,葱,油,老抽,盐,水,水淀粉 </p> -->
								<span><%=picToCookbooks.get(i).getInfo()%></span>
								<div class="score">
								<!-- 收藏开始 -->
									<span class="shoucangzi">收藏</span> 
									<img width="20" class="shoucang"src="<%=path%>/img/shoucangkongxin.jpg">
								<!-- 收藏结束 -->
								</div>


								<div class="aut-num clearfix text-lips ">
									<a class="headicon"
										href="<%=path %>/PersonalServlet?action=init&id=<%=picToCookbooks.get(i).getUserinfo().getId() %>"
										target="_blank" one-link-mark="yes"> 
									<img src="<%=path%>/static/image/<%=picToCookbooks.get(i).getUserinfo().getAvatar()%>"><%=picToCookbooks.get(i).getUserinfo().getName()%>
									</a> <a class="proicon" href="https:#"
										target="_blank" one-link-mark="yes"> </a>
								</div>
							</div></li>
						<%
							}
								%>
								<!-- 显示数字 -->
						<div class="mt20">
							<div class="pages" >

								<%
									Pager pager=(Pager)request.getAttribute("pager");
														int start = 1;
														int end = pager.getPageCount();
														if(pager.getPageCount()>5)
														{
															start = pager.getPageNo()-2<1?1:pager.getPageNo()-2;
															end = start+4;
															if(end>pager.getPageCount())
															{
																end = pager.getPageCount();
																start = end-4;
															}
										}
														%>
														<a href="javascript:void(0)"  class="prevPager" one-link-mark="yes">上一页</a>
														<% 
										for (int i = start; i <= end; i++) {

											if (i == pager.getPageNo()) {
								%>
								<a href="javascript:void(0)" style="color:red" class="aliaon" one-link-mark="yes"><%=i%></a>
								<%
									} else {
								%><a href="javascript:void(0)" class="aliaon" one-link-mark="yes"><%=i%></a>
								<%
									}
										}				
								%>
								
								<a href="javascript:void(0)"  class="nextPager" one-link-mark="yes">下一页</a>
								<a href="javascript:void(0)"  class="aliaon" one-link-mark="yes"><%=pager.getPageNo()%>/<%=pager.getPageCount() %></a>
							
	<!-- 上下页事件开始 -->
<script type="text/javascript">
$(function(){
	//上一页点击事件
	$(".prevPager").click(function(){
		var n=<%=pager.getPageNo()%>;
		$.ajax({
			url:"<%=request.getContextPath()%>/indexServlet",
			data:{action:"recipetypeSecondCookbookElse",pageNo:n-1,name:"<%=name%>"},
			success:function(mes){
				$("#showList").html(mes);
			}
			
		});
	});
	//下一页点击事件
	$(".nextPager").click(function(){
		var n=<%=pager.getPageNo()%>;
		$.ajax({
			url:"<%=request.getContextPath()%>/indexServlet",
			data:{action:"recipetypeSecondCookbookElse",pageNo:n+1,name:"<%=name%>"},
			success:function(mes){
				$("#showList").html(mes);
			}
			
		});
	});

})
</script>	
<!--上下页事件结束  -->		
							
							</div>
						</div>
						<!-- 显示数字结束 -->

						<%
							}
						%>


					</ul>

					<!--一个菜谱展示结束  -->
					

				</div>
			</div>
		</div>
		<!-- 面包屑导航 -->

	</div>

	</div>
	</div>
	<jsp:include page="/inc/foot.jsp"></jsp:include>
	<script src="<%=path%>/static/cookbookShow_files/tip.js.下载"></script>
	<script src="<%=path%>/static/cookbookShow_files/search.js.下载"></script>
	<script src="<%=path%>/static/cookbookShow_files/main.js.下载"></script>
	<!-- <script src='https://s13.cnzz.com/c.php?id=30029854' language='JavaScript' charset='gb2312'></script> -->

	<style>
#right {
	float: right;
}

.mb25 {
	padding-top: 20px;
}

.recipename {
	font-size: 18px;
	font-weight: bold;
}

.searchall {
	font-size: 24px;
}

.small_search {
	display: inline-block;
}
</style>
</body>
</html>
<!-- 收藏事件开始 -->
<script type="text/javascript">
	$(function(){
		$(".shoucang").click(function(){
			var shoucangsrc=$(this).attr("src");
			if(shoucangsrc=="<%=path%>/img/shoucangkongxin.jpg"){
				$(this).attr("src","<%=path%>/img/shoucangshixin.jpg");
				$(this).prev().html("已收藏")
			}
			else{
				$(this).attr("src","<%=path%>/img/shoucangkongxin.jpg");
					$(this).prev().html("收藏")
				}
			});
	});
</script>
<!-- 收藏事件结束 -->
<!-- 给数字number添加事件 -->
<script type="text/javascript">
	$(function(){
		
		//给所有的数字添加的事件
	
		$("#showList").on("click",".aliaon",function(){
			
			var n = $(this).html();
			$.ajax({
				url:"<%=request.getContextPath()%>/indexServlet",
				type:"get",
				data:{action:"recipetypeSecondCookbookElse",pageNo:n,name:"<%=name%>"},
				success:function(mes){
					$("#showList").html(mes);
				}
			});
			
		});
		
	});
</script>
<!-- number数字的事件结束 -->